{#include file="top.php"#}
<script type="text/javascript" src="/js/ZeroClipboard.js"></script>
<script type="text/javascript">
    function select(){
        var s = $("#select_c");
        if(parseInt(s.attr('v'))==0){
            s.show();
            s.attr('v',1);
        }else{
            s.hide();
            s.attr('v',0);
        }
    }

    function callback(content){
        switch(content['retcode']){
            case 1:
                $("#p_type_name").html(content['data']['type_name']);
                $("#p_cname").html(content['data']['cname']);
                $("#p_date").html(content['data']['date']);
                showLB('#dialog',0);
                $("#message").html("你已成功申請‘"+content['data']['cname']+"’報告延期提交，請於‘"+content['data']['date_l']+"’前提交報告！");
                $("#message").show();
                $("#endtime_"+content['data']['pid']).html(content['data']['date_l']);
                $("#repbt").attr('onclick','javascript:window.location.href=\'/product.php?action=report_add&pid='+content['data']['pid']+'\'');
                break;
            default:
                break;
        }
    }

    function showLB(ct,n){
        var sh=$(document).height();
        var sw=$(document).width();
        var st=$(window).scrollTop();
        var ch=$(window).height();
        var cw=$(window).width();
        var tbT=(Number(ch)/3+Number(st))+"px";
        var tbL=(Number(cw)/2)+"px";
        if(n==0){
            $("#fullbg").css({width:sw,height:sh});
            $(ct).css({top:tbT,left:tbL});
            $("#fullbg").fadeTo('slow', 0.4);
            $(ct).fadeIn('slow');
            $(window).scroll(function(){showLB(ct,1)});
            $(window).resize(function(){showLB(ct,1)});
        }else{
            if($("#fullbg").css("display")=="block"){
                $("#fullbg").css({width:sw,height:sh});
                $(ct).css({top:tbT,left:tbL});
            }
        }
    }

    function closeLB(){
        $("#fullbg").fadeOut('slow');
        $('#dialog').fadeOut('slow');
        $('#dialog_popup').fadeOut('slow');
        $('#dialog1').fadeOut('slow');



    }

    var clip = null;
    $(document).ready(function(){
        clip = new ZeroClipboard.Client();
        clip.setHandCursor( true );

        clip.addEventListener('load', function (client) {
        });

        clip.addEventListener('mouseOver', function (client) {
                clip.setText( $('#share_url').val() );
        });

        clip.addEventListener('complete', function (client, text) {
                alert('複製成功');
        });

        clip.glue( 'copy_bt');
    });
</script>

<div class="body">
    <div class="main fl">
        <div class="tips" style='{#if empty($msg)#}display:none;{#/if#}'>
            <strong class="ir warn_icon"><span>提示</span></strong>
            <label id='message'>{#$msg#}</label>
        </div>

        <div class="ibox clearfix">
            <figure class="imgbox">
                <a href="{#optimize_url('person', 'report','username='|cat:$member.username)#}"><img src="{#$member.photo_l#}"  width=77> </a>
            </figure>
            <h3 class="title">
                <a class="title" href="{#optimize_url('person', 'report','username='|cat:$member.username)#}">{#$member.username#}</a>
                <span class="myreport">我的報告：{#$member.reports_count#}</span>
                <a href="/member.php?action=MyReg" class="btn_b btn_b_editfile"><strong>編輯個人檔案</strong></a>
            </h3>
<!--            <p>年齡：{#$member.age_group#}</p>
            <p>膚質：{#$member.body_skin#}</p>
            {#if $member.fav_brand_top#}
            <p>最愛品牌：{#$member.fav_brand_top#}
                {#if $member.fav_brand#}
                <i class="tri down" onclick="$('.brand_all').slideToggle('fast');"></i>
                {#/if#}
            </p>
            {#/if#}
            <div class="brand_all" style="display:none">{#$member.fav_brand#}</div>

            {#if $member.reports_count#}<p>提交報告：{#$member.reports_count#}</p>{#/if#}
            {#if $memberData.facebook.id#}<p>已綁定facebook {#$memberData.email#}</p>{#/if#}-->

            <div class="point_record">
                <table class="point_record_tb">
                    <tr>
                        <td class="td1">
                            <a href="/member_center.php?action=points#show_point">詳細記錄</a>
                        </td>
                        <td class="td2">
                            <a href="{#optimize_url('help', 'show','page=4')#}" target="_blank">如何賺分？</a>
                        </td>
                        <td class="td3">
                            <span class="now">現有
                                iTrial分</span><span class="font_red">{#$member.points#}</span><a href="{#optimize_url('help', 'show','page=4')#}" target="_blank"><i class="icon point"></i></a>
                        </td>
                    </tr>
                </table>

            </div>
            <div class="btnsbox">
                <div class="flbox">
                    <a href="/member_center.php?action=blog_do&do=1" class="btn_b btn_b_edit">編寫blog</a>
                    {#if empty($member.member_type)#}<a href='/member.php?action=regTrial' class="btn_b btn_b_totrydaren"><strong>成為試用專員</strong></a>
                    {#else if $isexp neq 1#}<a href='/member.php?action=regExpert' class="btn_b btn_b_todaren"><strong>成為體驗達人</strong></a>{#/if#}
                </div>
                <div class="frbox">
                    <em class="icon {#if $member.member_type eq 5#}ycicon{#else if $member.member_type eq 1#}icon_master_g{#else#}icon_master_m{#/if#}">{#if $member.member_type eq 5#}尊業體驗團{#else if $member.member_type eq 1#}試用專員{#else#}正式會員{#/if#}</em>
                </div>
                {#if $member._status eq 1#}<p class="statu">審核中</p>{#/if#}
            </div>
        </div>
        <div class="point_intro">
            <p class="recom">推介朋友賺取iTrial分：<input type="text" class="ipt_text" id="share_url" readOnly="readOnly" value="{#$member.share_url#}"/><a class="point_copy" href="javascript::" id="copy_bt"><strong>複製</strong></a><a target="_blank" href="{#optimize_url('help', 'show','page=4')#}" class="icon question"></a></p>
            <p class="share">你可以透過任何方法，推介朋友申請成為試用專員或體驗達人，便可賺取 1 個 iTrial 分，每天上限為 5 分，即推介 5 位朋友。</p>
        </div>

        <div class="b_box cr_tagb_box list_row tagb_box">
            <div class="slt slt_d" onclick="select()">
                <strong class="tri down"></strong>
            </div>
            <div class="sltbox sltbox_d">
                <div class="dt" onclick="select()">
                    {#$select.$option#}
                </div>
                <div id="select_c" v=0 class="dd" style="display:none">
                    {#foreach  from=$select item=v key=k#}
                    <p><a href="/member_center?action=report&option={#$k#}">{#$v#}</a></p>
                    {#/foreach#}
                </div>
            </div>
            <div class="tab_b_box tab_b_box_l tab_b_box_m">
                <a href="/member_center.php?action=invite">產品 / 活動</a>
                <a class="curr" href="/member_center.php?action=report">產品報告</a>
                <a href="/member_center.php?action=attention">關注會員</a>
                <a href="/member_center.php?action=points">iTrial分</a>
                <a href="/member_center.php?action=blog">Blog</a>
                <em class="line"></em>
            </div>

            <!--產品報告-->
            <p class="n_title">我的報告</p>
            {#if ($more_type eq 1 || empty($more_type)) && !empty($submit_reports)#}
            <div class="hd_grey">提交報告</div>
            {#if !empty($submit_reports.pageinfo.total)#}
            <div class="report_box b_box">
                <div class="bd">
                    <ul class="report_list">
                        {#foreach  from=$submit_reports.result item=v key=k#}
                        {#if $v._bt_s neq 5 && $v._bt_s#}
                        <li>
							<div class="img_box"><p class="img_p"><a {#if $v._bt_s neq 1#}href="{#$v._bturl#}"{#/if#} {#if $v._bt_s eq 3#}onclick="showpop({#$v.product#},'{#$warntxt#}');"{#/if#}><span><img src="{#$v._photo_url#}"></span></a></p></div>
                            {#if $v._bt_s neq 4#}
                            <a id='repbt' class="{#$v._css#}" {#if $v._bt_s neq 1#}href="{#$v._bturl#}"{#/if#} {#if $v._bt_s eq 3#}onclick="showpop({#$v.product#},'{#$warntxt#}');"{#/if#} ><strong>{#$v._bt#}</strong></a>
                            {#/if#}
                            <!--<a id='repbt' class="{#$v._css#}" {#if empty($v._bt_delay)#}onclick="javascript:window.location.href='{#$v._bturl#}';"{#else#}onclick="window.open('{#$v._bturl#}','iframe1');"{#/if#}><strong>{#$v._bt#}</strong></a>-->

                            <div class="info">
                                <h4 class="product_brand"><a class="product_brand" {#if $v._bt_s neq 1#}href="{#$v._bturl#}"{#/if#} {#if $v._bt_s eq 3#}onclick="showpop({#$v.product#},'{#$warntxt#}');"{#/if#} >{#$v.type_name#}</a></h4>
                                <p class="product_title">
                                    <a {#if $v._bt_s neq 1#}href="{#$v._bturl#}"{#/if#} {#if $v._bt_s eq 3#}onclick="showpop({#$v.product#},'{#$warntxt#}');"{#/if#} >
                                        {#$v.name#}<br/>
                                        {#$v.cname#}</a>
                                </p>
                                <table class="report_tb" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td class="td_l">試用名額</td><td class="td_m">：</td><td class="td_r">{#$v.quota#}</td>
                                    </tr>
                                    <tr>
                                        <td class="td_l">申請人數</td><td class="td_m">：</td><td class="td_r">{#$v.apply_num#}</td>
                                    </tr>
                                    <tr>
                                        <td class="td_l">開始日期</td><td class="td_m">：</td><td class="td_r"><span id='endtime_{#$v.id#}'>{#date('Y-m-d',strtotime($v.my_report_starttime))#}</span></td>
                                    </tr>
                                    <tr>
                                        <td class="td_l">截止日期</td><td class="td_m">：</td><td class="td_r"><span id='endtime_{#$v.id#}'>{#date('Y-m-d',strtotime($v.my_report_endtime))#}</span></td>
                                    </tr>
                                    <tr>
                                        <td class="td_l">已提交報告</td><td class="td_m">：</td><td class="td_r">{#$v._rep_count#}</td>
                                    </tr>
                                </table>
                            </div>
                        </li>
                        {#/if#}
                        {#/foreach#}
                    </ul>
                </div>
            </div>
            {#else#}
            <div><br/>
                {#if $member.member_type==5#}
                立即申請體驗達人試用<a href="{#optimize_url('product', 'invite_list','mtype=5')#}" class="btn_s btn_s_apply"><strong>立即申請</strong></a>
                {#else#}
                立即申請試用專員試用<a href="{#optimize_url('product', 'invite_list','mtype=1')#}" class="btn_s btn_s_apply"><strong>立即申請</strong></a>
                {#/if#}
            </div>
            {#/if#}
            {#if empty($more_type) && $submit_reports.pageinfo.total>4#}
            <p class="more_p"><a href="/member_center.php?action=report&more_type=1&ps1=6" class="more">更多</a></p>
            {#elseif !empty($more_type)#}
            {#$pagelist1#}
            {#/if#}
            {#/if#}


            {#if ($more_type eq 4 || empty($more_type)) && !empty($reject_reports.result)#}
            <div class="hd_grey">被駁回的報告</div>
            <div class="report_box b_box">
                <div class="bd">
                    <ul class="report_list">
                        {#foreach  from=$reject_reports.result item=v key=k#}
                        <li>
							<div class="img_box"><p class="img_p"><a href="{#$v._bturl#}"><span><img src="{#$v._photo_url#}"></span></a></p></div>
                            <a id="repbt" class="{#$v._css#}" href="{#$v._bturl#}"><strong>{#$v._bt#}</strong></a>

                            <div class="info">
                                <h4 class="product_brand"><a class="product_brand" href="{#$v._bturl#}">{#$v.type_name#}</a></h4>
                                <p class="product_title">
                                    <a href="{#$v._bturl#}">
                                        {#$v.name#}<br/>
                                        {#$v.cname#}</a>
                                </p>
                                <table class="report_tb" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td class="td_l">試用名額</td><td class="td_m">：</td><td class="td_r">{#$v.quota#}</td>
                                    </tr>
                                    <tr>
                                        <td class="td_l">申請人數</td><td class="td_m">：</td><td class="td_r">{#$v.apply_num#}</td>
                                    </tr>
                                    <tr>
                                        <td class="td_l">開始日期</td><td class="td_m">：</td><td class="td_r"><span id='endtime_{#$v.id#}'>{#date('Y-m-d',strtotime($v.report_starttime))#}</span></td>
                                    </tr>
                                    <tr>
                                        <td class="td_l">截止日期</td><td class="td_m">：</td><td class="td_r"><span id='endtime_{#$v.id#}'>{#date('Y-m-d',strtotime($v.report_endtime))#}</span></td>
                                    </tr>
                                    <tr>
                                        <td class="td_l">已提交報告</td><td class="td_m">：</td><td class="td_r">{#$v._rep_count#}</td>
                                    </tr>
                                </table>
                            </div>
                        </li>
                        {#/foreach#}
                    </ul>
                </div>
            </div>
            {#if empty($more_type) && $reject_reports.pageinfo.total>4#}
            <p class="more_p"><a href="/member_center.php?action=report&more_type=4&ps1=6" class="more">更多</a></p>
            {#elseif !empty($more_type)#}
            {#$pagelist4#}
            {#/if#}
            {#/if#}


            {#if ($more_type eq 2 || empty($more_type)) && !empty($my_reports)#}
            <div class="hd_grey">我提交的報告</div>
            {#foreach  from=$my_reports item=v key=k#}
            <div class="b_box b_box_pro_rep {#if $k eq 5#}b_box_pro_rep_1{#/if#}">
                <div class="bd">
                    <div class="box_hd box_hd_w">
                        <figure class="img_box">
							<p class="img_p"><a href="{#optimize_url('product', 'detail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id)#}"><span><img src="{#$v.product.photo#}"></span></a></p>
                        </figure>
                        <h2 class="title_en"><a href="{#optimize_url('product', 'detail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id)#}" class="product_brand">{#$v.product.type_name#}</a></h2>
                        <h3 class="title_cn"><a href="{#optimize_url('product', 'detail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id)#}">{#$v.product.cname#}</a></h3>
                        <div class="intro">
                            <span><sup>好</sup>{#$v.product.good#}</span>
                            <em>/</em>
                            <span><sup>一般</sup>{#$v.product.common#}</span>
                            <em>/</em>
                            <span><sup>差</sup>{#$v.product.bad#}</span>
                        </div>
                    </div>
                    <div class="box_mid">
                        <p>總評：{#if $v.report.well==1#}很好{#else if $v.report.well==2#}好{#else if $v.report.well==3#}一般{#else if $v.report.well==4#}差{#else if $v.report.well==5#}很差{#/if#}</p>
                        <div class="star_box">
                            <table>
                                <tbody>
                                    <tr>
                                        {#foreach  from=$v.report.category item=v1 key=k1#}
                                        <th>{#$v1.name#}</th>
                                        <td><strong class="star star_{#$v1.value#}">{#$v1.value#}星</strong></td>
                                        {#if (($k1+1)%3) eq 0#}</tr><tr>{#/if#}
                                        {#/foreach#}
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <p class="que"><a class="que" href="{#optimize_url('product', 'reportDetail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id|cat:'&rid='|cat:$v.report.id)#}">{#$v.report.title#}</a></p>
                        <p>{#$v.report.time#}</p>
                    </div>
                    <div class="box_bot">
                        <p><a href="{#optimize_url('product', 'reportDetail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id|cat:'&rid='|cat:$v.report.id)#}">{#$v.report.body#}</a></p>
                        <ul class="clearfix">
                            {#foreach  from=$v.report.content item=v2 key=k2#}
                            {#if $v2.p && $k2<4#}<li {#if $k2 eq 3#}class="last"{#/if#}>
							<div class="img_box"><p class="img_p"><a href="{#optimize_url('product', 'reportDetail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id|cat:'&rid='|cat:$v.report.id)#}"><span><img src="{#$v2.p#}" alt="pic"></span></a></p></div>
							</li>{#/if#}
                            {#/foreach#}
                        </ul>
                    </div>
                </div>
            </div>
            {#/foreach#}
            {#if empty($more_type) && $my_reports_res.pageinfo.total>2#}
            <p class="more_p"><a href="/member_center.php?action=report&more_type=2&ps2=4" class="more">更多</a></p>
            {#elseif !empty($more_type)#}
            {#$pagelist2#}
            {#/if#}
            {#/if#}

            {#if ($more_type eq 3 || empty($more_type)) && !empty($my_like_reports)#}
            <div class="hd_grey">我推薦的報告</div>
            {#foreach  from=$my_like_reports item=v key=k#}
            <div class="b_box b_box_pro_rep {#if $k eq 5#}b_box_pro_rep_1{#/if#}">
                <div class="bd">
                    <div class="box_hd box_hd_w">
                        <figure class="img_box">
							<p class="img_p"><a href="{#optimize_url('product', 'detail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id)#}"><span><img src="{#$v.product.photo#}"></span></a></p>
                        </figure>
                        <h2 class="title_en"><a href="{#optimize_url('product', 'detail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id)#}"  class="product_brand">{#$v.product.type_name#}</a></h2>
                        <h3 class="title_cn"><a href="{#optimize_url('product', 'detail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id)#}">{#$v.product.cname#}</a></h3>
                        <div class="intro">
                            <span><sup>好</sup>{#$v.product.good#}</span>
                            <em>/</em>
                            <span><sup>一般</sup>{#$v.product.common#}</span>
                            <em>/</em>
                            <span><sup>差</sup>{#$v.product.bad#}</span>
                        </div>
                    </div>
                    <div class="box_mid">
                        <p>總評：{#if $v.report.well==1#}很好{#else if $v.report.well==2#}好{#else if $v.report.well==3#}一般{#else if $v.report.well==4#}差{#else if $v.report.well==5#}很差{#/if#}</p>
                        <div class="star_box">
                            <table>
                                <tbody>
                                    <tr>
                                        {#foreach  from=$v.report.category item=v1 key=k1#}
                                        <th>{#$v1.name#}</th>
                                        <td><strong class="star star_{#$v1.value#}">{#$v1.value#}星</strong></td>
                                        {#if (($k1+1)%3) eq 0#}</tr><tr>{#/if#}
                                        {#/foreach#}
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <p class="que"><a class="que" href="{#optimize_url('product', 'reportDetail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id|cat:'&rid='|cat:$v.report.id)#}">{#$v.report.title#}</a></p>
                        <p>{#$v.report.time#}</p>
                    </div>
                    <div class="box_bot">
                        <p><a href="{#optimize_url('product', 'reportDetail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id|cat:'&rid='|cat:$v.report.id)#}">{#$v.report.body#}</a></p>
                        <ul class="clearfix">
                            {#foreach  from=$v.report.content item=v2 key=k2#}
                            {#if $v2.p && $k2<4#}<li {#if $k2 eq 3#}class="last"{#/if#}>
							<div class="img_box"><p class="img_p"><a href="{#optimize_url('product', 'reportDetail','mtype='|cat:$v.product.member_type|cat:'&pid='|cat:$v.product.id|cat:'&rid='|cat:$v.report.id)#}"><span><img src="{#$v2.p#}" alt="pic"></span></a></p></div>
							</li>{#/if#}
                            {#/foreach#}
                        </ul>
                    </div>
                </div>
            </div>
            {#/foreach#}

            {#if $my_like_reports_num.total>2 && empty($more_type)#}
            <p class="more_p"><a href="/member_center.php?action=report&more_type=3&ps2=4" class="more">更多</a></p>
            {#elseif !empty($more_type)#}
            {#$pagelist3#}
            {#/if#}
            {#/if#}

        </div><!--tagb_box-->
    </div>
    <!-- main-->
    <div class="sidebar">
        {#show_block('b2',1,'','sidebar_ad')#}
        {#show_block('b1',2,'','sidebar_function')#}
        {#show_block('b3',0,'','sidebar_search')#}
        {#show_block('b9',0,'','sidebar_tutorial b_box')#}
        {#show_block('b6',0,'','sidebar_facebook')#}
    </div>
    <!-- sidebar -->

</div><!--body-->
<div id="fullbg"></div>
<div id='dialog'  class="apopbox popbox b_box" style="top:300px;z-index: 60;	display:none;" >
    <div class="hd">
        <h2 class="ir ht"><span>提示信息 ALERT</span></h2>
        <a href='javascript:void(0);' onclick="closeLB();location.href='/';" class="popclose">close</a>
    </div>
    <div class="bd">
        <p>您已成功提交申請！</p>
        <p>獲邀會員名單將於「體驗獲邀」頁面上公佈，及個别以Email通知，敬請留意！</p>
        <a href="{#optimize_url('product', 'invite_list','mtype=1')#}" class="btn_b seemore_try"><strong>查看更多試用</strong></a>
        <span class="sep">/</span>
        <a href="{#optimize_url('product', 'invite_list','mtype=5')#}" class="btn_b seemore_tuan"><strong>查看更多體驗團</strong></a>
    </div>
</div>
<div id='dialog1'   class="apopbox popbox b_box" style="top:300px;z-index: 60;	display:none;" >
    <div class="hd">
        <h2 class="ir ht"><span>提示信息 ALERT</span></h2>
        <a href='javascript:void(0);' onclick="closeLB();" class="popclose">close</a>
    </div>
    <div class="bd">
        <div class="multi">
            <p>你已申請逾期提交報告，iMORE 將紀錄在案，保留取消閣下資格之權利。</p>
            <p class="product" id="p_info"><span id="p_type_name"></span><br><span id="p_cname"></span></p>
            <p>你必須於<span id='p_date'></span>前提交報告！</p>
            <p>*每個試用只能申請延期一次！</p>
        </div>
    </div>
</div>
<div style="top:400px;z-index:60;display:none;" class="apopbox popbox b_box" id="dialog_popup">
    <div class="hd">
        <h2 class="ir ht"><span>提示信息 ALERT</span></h2>
        <a class="popclose" onclick="closeLB();" style="cursor:pointer">close</a>            </div>
    <div class="bd">
        <p id="popupText"></p>
        <a class="btn_s btn_s_next" id="next_k" href=""><strong>下一步</strong></a>
    </div>
</div>
<div style="top:400px;z-index:60;display:none;" class="apopbox popbox b_box" id="dialog2">
    <div class="hd">
        <h2 class="ir ht"><span>提示信息 ALERT</span></h2>
        <a class="popclose" onclick="closeLB();" style="cursor:pointer">close</a>            </div>
    <div class="bd">
        <p id="popupText2"></p>
        <a class="btn_b btn_s_im_back" href="javascript:void(0);" onclick="closeLB();"><strong>立即返回</strong></a>            </div>
</div>
<script>
    function showpop(k,text){
        $("#fullbg").fadeIn();
        $("#dialog1").fadeOut('slow');
        $("#dialog").fadeOut('slow');
        showLB('#dialog_popup',0);
        $("#popupText").text(text);
        $("#next_k").attr('href',"/report-add-"+k+".html");
    }
</script>
<iframe id="iframe1" name="iframe1" style="display:none"></iframe>
{#include file="footer.php"#}